<?php

use yii\helpers\Url;
use yii\helpers\Html;
use yii\helpers\ArrayHelper;
use website\helpers\Render;
use common\models\User;
use common\models\Design;
use common\models\Category;
use common\models\UserUpload;

$this->addCrumbs('个人设置');
$this->title = '邀请链接';
?>
<style>
    #invites-courtesy {width:100%;padding-top:44px;margin-left:10px;height:403px;font-weight:700;color:#fff;text-align:center;background:url(<?= Url::to('@web/web/static/image/index/invitings.jpg')  ?>) no-repeat;}
    #inviting-code-address{margin-left:10px;margin-bottom:20px;line-height:60px;border-bottom:1px solid #ccc;}
    #invites-title {width:100%;padding-top:2%;margin-left:0px;height:91px;background:url(<?= Url::to('@web/web/static/image/index/inviting.png')  ?>) no-repeat;}
    #biao1{padding-top:2%;display:-moz-inline-box;display:inline-block;width:44%;white-space:nowrap;overflow:hidden;margin-left:23%;}
    #button{margin-right:18%;margin-top:10%;}
</style>
<div class="contenter">
    <?= $this->render('/user/navigator', ['active' => 'invites-courtesy']) ?>
    <div id="user-contenter">
        <div class="box-shadow" id="sub-contenter">
            <div class="data-title"><span class="h3"><?= $this->title ?></span></div>
            <div class="data-content flyer-form">
                <div id="invites-courtesy">
                </div>
                <div class="data-content pd-20px">
                    <div id="inviting-code-address">
                        活动规则:老用户邀请新用户注册平台设计师并缴纳保证金入驻成功可以在线接单，平台审核完成即可置顶老用户简历7天

                    </div>
                    <div class="data-content pd-20px">
                        <div id="invites-title">
                                <textarea cols="70" rows="1" id="biao1"><?= $invitingcode ?></textarea>
                                <input id ="button" type="button" onClick="copyUrl2()" class="fr flyer-button normal border-round thin mt-7px" value="复制粘贴">
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script src="<?= Render::static('flyer/flyer.class.js') ?>"></script>
<script src="<?= Render::static('flyer/checker.class.js') ?>"></script>
<script src="<?= Render::static('flyer/tableHandler.class.js') ?>"></script>
<script src="<?= Url::to('@web/web/static/js/ZeroClipboard.js') ?>"></script>
<script>
    function copyUrl2()
    {
        var Url2=document.getElementById("biao1");
        Url2.select(); // 选择对象
        document.execCommand("Copy"); // 执行浏览器复制命令
        alert("已复制好，可贴粘。");
    }
</script>